<?php
/**
 * The Header for our theme.
 *
 * Displays all of the <head> section and everything up till <div id="main">
 *
 * @package web2feel
 * @since web2feel 1.0
 */

?><!DOCTYPE html>
<html <?php language_attributes(); ?>>
<head>
<meta charset="<?php bloginfo( 'charset' ); ?>" />
<meta name="viewport" content="width=device-width" />
<title><?php
	/*
	 * Print the <title> tag based on what is being viewed.
	 */
	global $page, $paged;

	wp_title( '|', true, 'right' );

	// Add the blog name.
	bloginfo( 'name' );

	// Add the blog description for the home/front page.
	$site_description = get_bloginfo( 'description', 'display' );
	if ( $site_description && ( is_home() || is_front_page() ) )
		echo " | $site_description";

	// Add a page number if necessary:
	if ( $paged >= 2 || $page >= 2 )
		echo ' | ' . sprintf( __( 'Page %s', 'web2feel' ), max( $paged, $page ) );

	?></title>
<link rel="profile" href="http://gmpg.org/xfn/11" />
<link rel="pingback" href="<?php bloginfo( 'pingback_url' ); ?>" />
<link href='http://fonts.googleapis.com/css?family=Lato:400,300,700,900' rel='stylesheet' type='text/css'>
<link rel="stylesheet" type="text/css" href="<?php bloginfo("template_url");?>/css/theme.css">

<!--[if lt IE 9]>
<script src="<?php echo get_template_directory_uri(); ?>/js/html5.js" type="text/javascript"></script>
<![endif]-->

<?php wp_head(); ?>
<?php 
			if(is_user_logged_in())
			{
				global $current_user;
				?>
				<script type="text/javascript">
					var wsUri = "ws://127.0.0.1:9070/server.php";   
				    wsocket = new WebSocket(wsUri);
				    jQuery(document).ready(function(){
					        var socket_call=	setInterval(function () {
					        		msg="1";
								  	name="aaaa";
								    var msg = {
						            tupe: 'connection',
						            name: name,
						            user_id:"<?php echo $current_user->id; ?>"
							        };
						        	wsocket.send(JSON.stringify(msg));
						        	clearInterval(socket_call);
					        	}, 3000);
					    });
				</script>
				<?php
			}
		 ?>
</head>

<body <?php body_class(); ?>>
<div id="page" class="hfeed site container_12">
<header>
	<div class="topmenu">
		<div class="toggle_button"><button><img id="toggle_icon" src="<?php echo get_template_directory_uri().'/images/black_arrow.png';?>"
		 alt="toggle"></button></div>
		<div id="logo">
			<a class="logo-link"  href="<?php echo home_url( '/' ); ?>">
				<p style="color:#fff;"><strong>image<span style="background: #54aa1e; border-radius: 10px;">Plus<span></strong></p>
			</a>
		</div>

		<nav class="menu_container">
			<?php wp_nav_menu( array( 'container_id' => 'submenu', 'theme_location' => 'primary','menu_id'=>'web2feel' ,'menu_class'=>'sfmenu','fallback_cb'=> 'fallbackmenu' ) ); ?>
		</nav>
		<div style="display:inline;float:left;position: relative; margin-left: 50px;width: auto">
		<form method='get' action="<?php echo site_url(); ?>" >
				<input type="text" name="bwg_search_head" id="search_key" style="height: 30px;width: 400px;padding: 0px;margin-top: 10px;border-radius: 0px;display: inline;position: relative;float:left" value="">
				<button id="search_button" style="height: 32px;padding: 0px;margin-top: 10px;margin-left: 0px; background: white; border-radius: 0px; font-size: 20px;display: inline;position: relative;float:left">Tìm</button>
		</form>
		</div>
		<nav class="secondmenu_container">
	
		<?php 
		wp_nav_menu(
			array('container_class'=>'submenu',
							 'container_id' => 'submenu',
							 'theme_location' => 'secondary','menu_id'=>'web2feel' ,
							 'menu_class'=>'sfmenu','fallback_cb'=> 'fallbackmenu' ) );
		?>
		</nav>
		<?php //get_search_form(); ?>
	</div>
</header>
<div id="main" class="site-main cf">
<?php get_sidebar(); ?>